﻿using LiteBlog.Components.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LiteBlog.Components.SiteMap
{
    internal class SiteMapProviderFactory
    {
        internal static ISiteMapProvider GetProvider(SiteMapComp comp, SiteMapType type)
        {
            switch (type)
            {
                case SiteMapType.Post:
                    return new PostProvider(comp.BlogRepo);
                case SiteMapType.Page:
                    return new PageProvider(comp.PageRepo);
                case SiteMapType.Category:
                    return new CategoryProvider(comp.CategoryRepo);
                case SiteMapType.Tag:
                    return new TagProvider();
                default:
                    return null;
            }
        }
    }
}
